<?php

/**
 * StatusModel
 *
 * @author Nguyen Tuan Anh
 * @version
 */

require_once 'Zend/Db/Table/Abstract.php';

class StatusModel extends Zend_Db_Table_Abstract {
	/**
	 * The default table name
	 */
	protected $_name = 'eway_status';
	protected $_dbAdapter;

	public function getAll(){
		$this->_dbAdapter = Zend_Registry::get(Constant::DB_ADAPTER);
		$sql = "SELECT * FROM ".$this->_name;
		$result = $this->_dbAdapter->fetchAll($sql);
		return $result;
	}

	public function getStatusById($sta_id){
		$this->_dbAdapter = Zend_Registry::get(Constant::DB_ADAPTER);
		$sql = "SELECT * FROM " . $this->_name . " WHERE sta_id=?";
		$result = $this->_dbAdapter->fetchRow($sql, $sta_id);
		return $result;
	}
}
